<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        main{
            display: table-cell;
            text-align: center;
            vertical-align: middle;
            width: 100vw;
            height: 100vh;
            background-color: #1d1c1c;
        }
        #font{
            display: inline-block;
            position: relative;
            font-size: 50px;
            color: #fff;
        }
        /* 原理：创建一个伪元素，文字设置成相同的，让伪元素与原文字重合，
         给伪元素设置不换行和溢出隐藏，实现遮盖，
         让宽度从0%到100%变化，让伪元素中的文字显露，实现变色*/
        #font::before{
            content: "HTML CSS JAVASCRIPT";
            position: absolute;
            white-space: nowrap;
            overflow: hidden;
            color: #06ee99;
            border-right: 3px solid #06ee99;
            /* 添加阴影的新方式（比box-shadow强） */
            filter:drop-shadow(0 0 50px #06ee99);
            animation: animate 3s linear infinite;
        }
        @keyframes animate {
            0%{
                width: 0;
            }
            100%{
                width: 100%;
            }
        }
    </style>
</head>

<body>
    <main>
        <div id="font">HTML CSS JAVASCRIPT</div>
    </main>
</body>

</html>